3.2.89 \(\int \cot (a+i \log (x)) \, dx\) [189]

Optimal. Leaf size=27 \[ -i x+2 i e^{i a} \tanh ^{-1}\left (e^{-i a} x\right ) \]

[Out]

-I*x+2*I*exp(I*a)*arctanh(x/exp(I*a))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.444, Rules used = {4588, 381, 396, 213} \begin {gather*} 2 i e^{i a} \tanh ^{-1}\left (e^{-i a} x\right )-i x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[a + I*Log[x]],x]

[Out]

(-I)*x + (2*I)*E^(I*a)*ArcTanh[x/E^(I*a)]

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 381

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[x^(n*(p + q))*(b + a/x^n)^
p*(d + c/x^n)^q, x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IntegersQ[p, q] && NegQ[n]

Rule 396

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(
p + 1) + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 4588

Int[Cot[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Int[((-I - I*E^(2*I*a*d)*x^(2*I*b*d))/(1 - E^(2*I*a
*d)*x^(2*I*b*d)))^p, x] /; FreeQ[{a, b, d, p}, x]

Rubi steps

\begin {align*} \int \cot (a+i \log (x)) \, dx &=\int \cot (a+i \log (x)) \, dx\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 42, normalized size = 1.56 \begin {gather*} -i x+2 i \tanh ^{-1}(x \cos (a)-i x \sin (a)) \cos (a)-2 \tanh ^{-1}(x \cos (a)-i x \sin (a)) \sin (a) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[a + I*Log[x]],x]

[Out]

(-I)*x + (2*I)*ArcTanh[x*Cos[a] - I*x*Sin[a]]*Cos[a] - 2*ArcTanh[x*Cos[a] - I*x*Sin[a]]*Sin[a]

________________________________________________________________________________________

Maple [A]
time = 0.05, size = 22, normalized size = 0.81

method result size
risch \(-i x +2 i \arctanh \left (x \,{\mathrm e}^{-i a}\right ) {\mathrm e}^{i a}\) \(22\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(a+I*ln(x)),x,method=_RETURNVERBOSE)

[Out]

-I*x+2*I*arctanh(x*exp(-I*a))*exp(I*a)

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 94 vs. \(2 (17) = 34\).
time = 0.28, size = 94, normalized size = 3.48 \begin {gather*} -{\left (\cos \left (a\right ) + i \, \sin \left (a\right )\right )} \arctan \left (\sin \left (a\right ), x + \cos \left (a\right )\right ) - {\left (\cos \left (a\right ) + i \, \sin \left (a\right )\right )} \arctan \left (\sin \left (a\right ), x - \cos \left (a\right )\right ) - \frac {1}{2} \, {\left (-i \, \cos \left (a\right ) + \sin \left (a\right )\right )} \log \left (x^{2} + 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) - \frac {1}{2} \, {\left (i \, \cos \left (a\right ) - \sin \left (a\right )\right )} \log \left (x^{2} - 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) - i \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x)),x, algorithm="maxima")

[Out]

-(cos(a) + I*sin(a))*arctan2(sin(a), x + cos(a)) - (cos(a) + I*sin(a))*arctan2(sin(a), x - cos(a)) - 1/2*(-I*c
os(a) + sin(a))*log(x^2 + 2*x*cos(a) + cos(a)^2 + sin(a)^2) - 1/2*(I*cos(a) - sin(a))*log(x^2 - 2*x*cos(a) + c
os(a)^2 + sin(a)^2) - I*x

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 49 vs. \(2 (17) = 34\).
time = 3.21, size = 49, normalized size = 1.81 \begin {gather*} -\sqrt {-e^{\left (2 i \, a\right )}} \log \left (x + i \, \sqrt {-e^{\left (2 i \, a\right )}}\right ) + \sqrt {-e^{\left (2 i \, a\right )}} \log \left (x - i \, \sqrt {-e^{\left (2 i \, a\right )}}\right ) - i \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x)),x, algorithm="fricas")

[Out]

-sqrt(-e^(2*I*a))*log(x + I*sqrt(-e^(2*I*a))) + sqrt(-e^(2*I*a))*log(x - I*sqrt(-e^(2*I*a))) - I*x

________________________________________________________________________________________

Sympy [A]
time = 0.10, size = 29, normalized size = 1.07 \begin {gather*} - i x - \left (i \log {\left (x - e^{i a} \right )} - i \log {\left (x + e^{i a} \right )}\right ) e^{i a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*ln(x)),x)

[Out]

-I*x - (I*log(x - exp(I*a)) - I*log(x + exp(I*a)))*exp(I*a)

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 38 vs. \(2 (17) = 34\).
time = 0.44, size = 38, normalized size = 1.41 \begin {gather*} i \, e^{\left (i \, a\right )} \log \left (i \, x + i \, e^{\left (i \, a\right )}\right ) - i \, e^{\left (i \, a\right )} \log \left (-i \, x + i \, e^{\left (i \, a\right )}\right ) - i \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x)),x, algorithm="giac")

[Out]

I*e^(I*a)*log(I*x + I*e^(I*a)) - I*e^(I*a)*log(-I*x + I*e^(I*a)) - I*x

________________________________________________________________________________________

Mupad [B]
time = 2.18, size = 29, normalized size = 1.07 \begin {gather*} -x\,1{}\mathrm {i}+\mathrm {atan}\left (\frac {x}{\sqrt {-{\mathrm {e}}^{a\,2{}\mathrm {i}}}}\right )\,\sqrt {-{\mathrm {e}}^{a\,2{}\mathrm {i}}}\,2{}\mathrm {i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(a + log(x)*1i),x)

[Out]

atan(x/(-exp(a*2i))^(1/2))*(-exp(a*2i))^(1/2)*2i - x*1i

________________________________________________________________________________________